package com.hoppinzq.test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.edge.EdgeOptions;

public class EdgeBrowser {
    private static WebDriver driver;
    public final static String hoppin="http://hoppin.cn/";
    public final static String hoppinzqVideo="https://hoppinzq.com/video/index.html";
    public static WebDriver getDriver(){
        // 设置Edge浏览器驱动路径
        System.setProperty("webdriver.edge.driver", "C:\\driver\\msedgedriver.exe");
        // 创建EdgeOptions对象，用于设置Edge浏览器的参数
        EdgeOptions options = new EdgeOptions();
        // 可选：设置Edge浏览器的启动路径
        // options.setBinary("path/to/edge/browser.exe");
        // 创建EdgeDriver对象，并将EdgeOptions传递给它
        WebDriver driver = new EdgeDriver(options);
        return driver;
    }
    public static void openWeb(String url){
        if(driver!=null) driver.get(url);
    }

    public static void quit(){
        if(driver!=null) driver.quit();
    }
}